package com.gs.process.demo.model;


import com.gs.process.core.user.SysUser;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author Shuai Guo
 * @version 1.0
 * @description
 * @date 2021/7/29
 */
public class SystemUser implements SysUser {

    private Long id;
    private String username;
    private Long dept;
    private String realName;
    private String userRoles;

    @Override
    public Long getUserId() {
        return this.id;
    }

    @Override
    public Long getUserDept() {
        return this.dept;
    }

    @Override
    public String getUsername() {
        return null;
    }

    @Override
    public List<Long> getUserRoles() {
        return Arrays.stream(this.userRoles.split(",")).map(Long::parseLong).collect(Collectors.toList());
    }

    @Override
    public String getUserRealName() {
        return this.realName;
    }
}
